# core/auth_manager.py - 修复验证管理器
class AuthManager:
    """权限验证管理器"""
    
    def __init__(self, config):
        self.config = config
        self.is_authenticated = False
    
    def check_upload_permission(self, password: str) -> bool:
        """检查上传权限"""
        if password == self.config.admin_password:
            self.is_authenticated = True
            return True
        self.is_authenticated = False
        return False
    
    def has_upload_permission(self) -> bool:
        """检查当前是否有上传权限"""
        return self.is_authenticated
    
    def logout(self):
        """退出登录状态"""
        self.is_authenticated = False